#region

using System;
using System.ComponentModel.DataAnnotations.Schema;

#endregion

namespace CuongHanh.Models
{
    [Table("tbl_Material")]
    public class Material : BaseClass
    {
        public string Name { get; set; }

        public string NameEn { get; set; }

        public string Code { get; set; }

        public string Image { get; set; }

        #region Function

        public Material()
        {
        }

        public Material(Material model)
        {
            Name = model.Name;
            NameEn = model.NameEn;
            Code = model.Code;
            Image = model.Image;
            Inactive = false;
            LastModified = DateTime.Now;
        }

        public void UpdateInfo(Material model)
        {
            Name = model.Name;
            NameEn = model.NameEn;
            Code = model.Code;
            if(!string.IsNullOrWhiteSpace(model.Image))
                Image = model.Image;
            Inactive = false;
            LastModified = DateTime.Now;
        }

        #endregion
    }
}
